package com.wb.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wb.common.vo.PositionModelVO;
import com.wb.system.domain.PositionModel;
import com.wb.system.mapper.PositionModelMapper;
import com.wb.system.service.IPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Description TODO
 * @Author zhangxl
 * @Date 2025/7/10 15:21
 */
@Service
public class PositionServiceImpl implements IPositionService {

    @Autowired
    private PositionModelMapper positionModelMapper;

    @Override
    public List<PositionModel> selectPositionList(PositionModelVO positionModelVO) {
        return positionModelMapper.selectPositionList(positionModelVO);
    }

    @Override
    public int savePosition(PositionModel position) {
        return positionModelMapper.savePosition(position);
    }

    @Override
    public PositionModel getPositionDetail(Long positionId) {
        return positionModelMapper.getPositionDetail(positionId);
    }

    @Override
    public int updatePositionById(PositionModel position) {
        return positionModelMapper.updatePositionById(position);
    }

    @Override
    public int removePositionById(Long positionId) {
        return positionModelMapper.removePositionById(positionId);
    }

    @Override
    public int updateStatus(PositionModel entity) {
        return positionModelMapper.updateStatus(entity);
    }

    @Override
    public int batchDeletePosition(List<Long> positionIds) {
        return positionModelMapper.batchDeletePosition(positionIds);
    }

    @Override
    public void removePositionByIds(List<Long> positionIds) {
        if (positionIds != null && positionIds.size() > 0) {
            for (Long positionId : positionIds) {
                positionModelMapper.removePositionById(positionId);
            }
        }
    }
}
